<?php 
	global $SSO, $Security, $AppID, $User, $DB;

	//Check to see if there is a valid session 
	$SessionInfo = $SSO->isValidSession("index.php?action=login", $SSO->getSessionInformation());	
	
	//Check to see if the user has rights to be on LWAdmin
	$PageRights = array('ADMIN', 'USERADMIN','MINIADMIN');
	$Security->ValidateUser($SessionInfo['username'], $AppID, $PageRights, 1);

	if(isset($_POST['txtUsername']) && !$SSO->CheckUserExists($_POST['txtUsername']))
	{
		header("Location: index.php?action=users_new&step=2&username=" . $_POST['txtUsername']);
		exit();
	}
	if($_POST['txtUsername'] == "")
	{
		header("Location: index.php?action=users_new&step=1");
		exit();
	}

	$UsersWindow = new window;
	$UsersWindow->title = "New User - Step 1 - Suggested Usernames";
	$UsersWindow->width = "400";
	$UsersWindow->start_window(); 
?>
<?php	$UsersWindow->end_window(); ?>